.class public Lcom/estrongs/android/ui/dialog/e1;
.super Lcom/estrongs/android/ui/dialog/q;
.source "WifiDialog.java"

# interfaces
.implements Landroid/view/View$OnClickListener;
.implements Landroid/text/TextWatcher;
.implements Landroid/widget/AdapterView$OnItemSelectedListener;


# instance fields
.field private final a:Les/z00$b;

.field private b:Landroid/view/View;

.field private c:I

.field private d:Landroid/widget/TextView;

.field private e:Les/z00;

.field private f:Landroid/widget/Button;


# direct methods
.method public constructor <init>(Landroid/content/Context;Les/z00;Les/z00$b;)V
    .locals 0

    .line 1
    invoke-direct {p0, p1}, Lcom/estrongs/android/ui/dialog/q;-><init>(Landroid/content/Context;)V

    const/4 p1, 0x0

    .line 2
    iput-object p1, p0, Lcom/estrongs/android/ui/dialog/e1;->f:Landroid/widget/Button;

    .line 3
    invoke-static {}, Lcom/estrongs/android/ui/theme/b;->r()Lcom/estrongs/android/ui/theme/b;

    .line 4
    iput-object p2, p0, Lcom/estrongs/android/ui/dialog/e1;->e:Les/z00;

    .line 5
    iput-object p3, p0, Lcom/estrongs/android/ui/dialog/e1;->a:Les/z00$b;

    .line 6
    invoke-virtual {p3}, Les/z00$b;->d()I

    move-result p1

    iput p1, p0, Lcom/estrongs/android/ui/dialog/e1;->c:I

    return-void
.end method

.method private a()Landroid/net/wifi/WifiConfiguration;
    .locals 4

    .line 2
    new-instance v0, Landroid/net/wifi/WifiConfiguration;

    invoke-direct {v0}, Landroid/net/wifi/WifiConfiguration;-><init>()V

    .line 3
    iget-object v1, p0, Lcom/estrongs/android/ui/dialog/e1;->a:Les/z00$b;

    .line 4
    invoke-virtual {v1}, Les/z00$b;->c()Ljava/lang/String;

    move-result-object v1

    .line 5
    invoke-static {v1}, Les/z00$b;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, v0, Landroid/net/wifi/WifiConfiguration;->SSID:Ljava/lang/String;

    .line 6
    iget v1, p0, Lcom/estrongs/android/ui/dialog/e1;->c:I

    if-eqz v1, :cond_3

    const/4 v2, 0x2

    if-eq v1, v2, :cond_0

    const/4 v0, 0x0

    return-object v0

    .line 7
    :cond_0
    iget-object v1, v0, Landroid/net/wifi/WifiConfiguration;->allowedKeyManagement:Ljava/util/BitSet;

    const/4 v2, 0x1

    invoke-virtual {v1, v2}, Ljava/util/BitSet;->set(I)V

    .line 8
    iget-object v1, p0, Lcom/estrongs/android/ui/dialog/e1;->d:Landroid/widget/TextView;

    invoke-virtual {v1}, Landroid/widget/TextView;->length()I

    move-result v1

    if-eqz v1, :cond_2

    .line 9
    iget-object v1, p0, Lcom/estrongs/android/ui/dialog/e1;->d:Landroid/widget/TextView;

    invoke-virtual {v1}, Landroid/widget/TextView;->getText()Ljava/lang/CharSequence;

    move-result-object v1

    invoke-interface {v1}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object v1

    const-string v2, "[0-9A-Fa-f]{64}"

    .line 10
    invoke-virtual {v1, v2}, Ljava/lang/String;->matches(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_1

    .line 11
    iput-object v1, v0, Landroid/net/wifi/WifiConfiguration;->preSharedKey:Ljava/lang/String;

    goto :goto_0

    .line 12
    :cond_1
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const/16 v3, 0x22

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    iput-object v1, v0, Landroid/net/wifi/WifiConfiguration;->preSharedKey:Ljava/lang/String;

    :cond_2
    :goto_0
    return-object v0

    .line 13
    :cond_3
    iget-object v1, v0, Landroid/net/wifi/WifiConfiguration;->allowedKeyManagement:Ljava/util/BitSet;

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Ljava/util/BitSet;->set(I)V

    return-object v0
.end method

.method static synthetic a(Lcom/estrongs/android/ui/dialog/e1;)Landroid/net/wifi/WifiConfiguration;
    .locals 0

    .line 1
    invoke-direct {p0}, Lcom/estrongs/android/ui/dialog/e1;->a()Landroid/net/wifi/WifiConfiguration;

    move-result-object p0

    return-object p0
.end method

.method private a(Landroid/view/ViewGroup;ILjava/lang/String;)V
    .locals 3

    .line 14
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/q;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/estrongs/android/pop/esclasses/h;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    const v1, 0x7f0c0369

    const/4 v2, 0x0

    invoke-virtual {v0, v1, p1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v0

    const v1, 0x7f090824

    .line 15
    invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/TextView;

    .line 16
    invoke-virtual {v1, p2}, Landroid/widget/TextView;->setText(I)V

    const p2, 0x7f090d57

    .line 17
    invoke-virtual {v0, p2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p2

    check-cast p2, Landroid/widget/TextView;

    .line 18
    invoke-virtual {p2, p3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 19
    invoke-virtual {p1, v0}, Landroid/view/ViewGroup;->addView(Landroid/view/View;)V

    return-void
.end method

.method static synthetic b(Lcom/estrongs/android/ui/dialog/e1;)Les/z00;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/ui/dialog/e1;->e:Les/z00;

    return-object p0
.end method

.method private b()V
    .locals 2

    .line 2
    iget v0, p0, Lcom/estrongs/android/ui/dialog/e1;->c:I

    const v1, 0x7f090421

    if-nez v0, :cond_0

    .line 3
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/e1;->b:Landroid/view/View;

    invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V

    return-void

    .line 4
    :cond_0
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/e1;->b:Landroid/view/View;

    invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/view/View;->setVisibility(I)V

    .line 5
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/e1;->d:Landroid/widget/TextView;

    if-nez v0, :cond_1

    .line 6
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/e1;->b:Landroid/view/View;

    const v1, 0x7f0908b0

    invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/estrongs/android/ui/dialog/e1;->d:Landroid/widget/TextView;

    .line 7
    invoke-virtual {v0, p0}, Landroid/widget/TextView;->addTextChangedListener(Landroid/text/TextWatcher;)V

    .line 8
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/e1;->b:Landroid/view/View;

    const v1, 0x7f090ad5

    invoke-virtual {v0, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/CheckBox;

    invoke-virtual {v0, p0}, Landroid/widget/CheckBox;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    :cond_1
    return-void
.end method

.method private c()V
    .locals 2

    .line 1
    iget v0, p0, Lcom/estrongs/android/ui/dialog/e1;->c:I

    const/4 v1, 0x2

    if-ne v0, v1, :cond_0

    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/e1;->d:Landroid/widget/TextView;

    invoke-virtual {v0}, Landroid/widget/TextView;->length()I

    move-result v0

    const/16 v1, 0x8

    if-ge v0, v1, :cond_0

    .line 2
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/e1;->f:Landroid/widget/Button;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/widget/Button;->setEnabled(Z)V

    goto :goto_0

    .line 3
    :cond_0
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/e1;->f:Landroid/widget/Button;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/widget/Button;->setEnabled(Z)V

    :goto_0
    return-void
.end method


# virtual methods
.method public afterTextChanged(Landroid/text/Editable;)V
    .locals 0

    .line 1
    invoke-direct {p0}, Lcom/estrongs/android/ui/dialog/e1;->c()V

    return-void
.end method

.method public beforeTextChanged(Ljava/lang/CharSequence;III)V
    .locals 0

    return-void
.end method

.method public onClick(Landroid/view/View;)V
    .locals 1

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/e1;->d:Landroid/widget/TextView;

    check-cast p1, Landroid/widget/CheckBox;

    .line 2
    invoke-virtual {p1}, Landroid/widget/CheckBox;->isChecked()Z

    move-result p1

    if-eqz p1, :cond_0

    const/16 p1, 0x90

    goto :goto_0

    :cond_0
    const/16 p1, 0x80

    :goto_0
    or-int/lit8 p1, p1, 0x1

    .line 3
    invoke-virtual {v0, p1}, Landroid/widget/TextView;->setInputType(I)V

    return-void
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 9

    .line 1
    iget-object v0, p0, Lcom/estrongs/android/ui/dialog/q;->mContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/estrongs/android/pop/esclasses/h;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    const v1, 0x7f0c0368

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v0

    iput-object v0, p0, Lcom/estrongs/android/ui/dialog/e1;->b:Landroid/view/View;

    .line 2
    invoke-virtual {p0, v0}, Lcom/estrongs/android/ui/dialog/q;->setContentView(Landroid/view/View;)V

    .line 3
    invoke-virtual {p0}, Landroid/app/Dialog;->getContext()Landroid/content/Context;

    move-result-object v0

    .line 4
    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    .line 5
    iget-object v2, p0, Lcom/estrongs/android/ui/dialog/e1;->a:Les/z00$b;

    invoke-virtual {v2}, Les/z00$b;->c()Ljava/lang/String;

    move-result-object v2

    invoke-static {v2}, Les/z00;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {p0, v2}, Lcom/estrongs/android/ui/dialog/q;->setTitle(Ljava/lang/CharSequence;)V

    .line 6
    iget-object v2, p0, Lcom/estrongs/android/ui/dialog/e1;->b:Landroid/view/View;

    const v3, 0x7f090551

    invoke-virtual {v2, v3}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v2

    check-cast v2, Landroid/view/ViewGroup;

    .line 7
    iget-object v3, p0, Lcom/estrongs/android/ui/dialog/e1;->a:Les/z00$b;

    invoke-virtual {v3}, Les/z00$b;->e()Landroid/net/NetworkInfo$DetailedState;

    move-result-object v3

    if-eqz v3, :cond_0

    const v4, 0x7f110b84

    .line 8
    invoke-virtual {p0}, Landroid/app/Dialog;->getContext()Landroid/content/Context;

    move-result-object v5

    invoke-static {v5, v3}, Les/z00$e;->a(Landroid/content/Context;Landroid/net/NetworkInfo$DetailedState;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {p0, v2, v4, v5}, Lcom/estrongs/android/ui/dialog/e1;->a(Landroid/view/ViewGroup;ILjava/lang/String;)V

    :cond_0
    const v4, 0x7f03001b

    .line 9
    invoke-virtual {v1, v4}, Landroid/content/res/Resources;->getStringArray(I)[Ljava/lang/String;

    move-result-object v4

    const v5, 0x7f110b7c

    .line 10
    iget-object v6, p0, Lcom/estrongs/android/ui/dialog/e1;->a:Les/z00$b;

    invoke-virtual {v6}, Les/z00$b;->d()I

    move-result v6

    aget-object v4, v4, v6

    invoke-direct {p0, v2, v5, v4}, Lcom/estrongs/android/ui/dialog/e1;->a(Landroid/view/ViewGroup;ILjava/lang/String;)V

    .line 11
    iget-object v4, p0, Lcom/estrongs/android/ui/dialog/e1;->a:Les/z00$b;

    invoke-virtual {v4}, Les/z00$b;->b()I

    move-result v4

    const/4 v5, -0x1

    if-eq v4, v5, :cond_1

    const v6, 0x7f03001c

    .line 12
    invoke-virtual {v1, v6}, Landroid/content/res/Resources;->getStringArray(I)[Ljava/lang/String;

    move-result-object v1

    const v6, 0x7f110b7f

    .line 13
    aget-object v1, v1, v4

    invoke-direct {p0, v2, v6, v1}, Lcom/estrongs/android/ui/dialog/e1;->a(Landroid/view/ViewGroup;ILjava/lang/String;)V

    .line 14
    :cond_1
    iget-object v1, p0, Lcom/estrongs/android/ui/dialog/e1;->a:Les/z00$b;

    invoke-virtual {v1}, Les/z00$b;->a()Landroid/net/wifi/WifiInfo;

    move-result-object v1

    if-eqz v1, :cond_2

    const v6, 0x7f110b80

    .line 15
    new-instance v7, Ljava/lang/StringBuilder;

    invoke-direct {v7}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v1}, Landroid/net/wifi/WifiInfo;->getLinkSpeed()I

    move-result v8

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v8, "Mbps"

    invoke-virtual {v7, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v7}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v7

    invoke-direct {p0, v2, v6, v7}, Lcom/estrongs/android/ui/dialog/e1;->a(Landroid/view/ViewGroup;ILjava/lang/String;)V

    .line 16
    invoke-virtual {v1}, Landroid/net/wifi/WifiInfo;->getIpAddress()I

    move-result v1

    if-eqz v1, :cond_2

    const v6, 0x7f110b73

    .line 17
    invoke-static {v1}, Landroid/text/format/Formatter;->formatIpAddress(I)Ljava/lang/String;

    move-result-object v1

    invoke-direct {p0, v2, v6, v1}, Lcom/estrongs/android/ui/dialog/e1;->a(Landroid/view/ViewGroup;ILjava/lang/String;)V

    .line 18
    :cond_2
    sget-object v1, Landroid/net/NetworkInfo$DetailedState;->CONNECTED:Landroid/net/NetworkInfo$DetailedState;

    if-eq v3, v1, :cond_3

    if-eq v4, v5, :cond_3

    .line 19
    invoke-direct {p0}, Lcom/estrongs/android/ui/dialog/e1;->b()V

    const v1, 0x7f110037

    .line 20
    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v1

    new-instance v2, Lcom/estrongs/android/ui/dialog/e1$a;

    invoke-direct {v2, p0}, Lcom/estrongs/android/ui/dialog/e1$a;-><init>(Lcom/estrongs/android/ui/dialog/e1;)V

    invoke-virtual {p0, v1, v2}, Lcom/estrongs/android/ui/dialog/q;->setConfirmButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/widget/Button;

    move-result-object v1

    iput-object v1, p0, Lcom/estrongs/android/ui/dialog/e1;->f:Landroid/widget/Button;

    .line 21
    :cond_3
    new-instance v1, Lcom/estrongs/android/ui/dialog/e1$b;

    invoke-direct {v1, p0}, Lcom/estrongs/android/ui/dialog/e1$b;-><init>(Lcom/estrongs/android/ui/dialog/e1;)V

    .line 22
    iget-object v2, p0, Lcom/estrongs/android/ui/dialog/e1;->f:Landroid/widget/Button;

    const v3, 0x7f110299

    if-nez v2, :cond_4

    .line 23
    invoke-virtual {v0, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0, v1}, Lcom/estrongs/android/ui/dialog/q;->setSingleButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)V

    goto :goto_0

    .line 24
    :cond_4
    invoke-virtual {v0, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0, v1}, Lcom/estrongs/android/ui/dialog/q;->setCancelButton(Ljava/lang/CharSequence;Landroid/content/DialogInterface$OnClickListener;)Landroid/widget/Button;

    .line 25
    :goto_0
    invoke-super {p0, p1}, Landroid/app/Dialog;->onCreate(Landroid/os/Bundle;)V

    .line 26
    iget-object p1, p0, Lcom/estrongs/android/ui/dialog/e1;->f:Landroid/widget/Button;

    if-eqz p1, :cond_5

    .line 27
    invoke-direct {p0}, Lcom/estrongs/android/ui/dialog/e1;->c()V

    :cond_5
    return-void
.end method

.method public onItemSelected(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 0

    .line 1
    iput p3, p0, Lcom/estrongs/android/ui/dialog/e1;->c:I

    .line 2
    invoke-direct {p0}, Lcom/estrongs/android/ui/dialog/e1;->b()V

    .line 3
    invoke-direct {p0}, Lcom/estrongs/android/ui/dialog/e1;->c()V

    return-void
.end method

.method public onNothingSelected(Landroid/widget/AdapterView;)V
    .locals 0

    return-void
.end method

.method public onTextChanged(Ljava/lang/CharSequence;III)V
    .locals 0

    return-void
.end method
